From 1ae4120aa8ce72e1097993d2361b10607fb1b45b Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Mon, 14 Nov 2005 11:47:38 +0100 Subject: [PATCH] Declare local variables at the start of a block, not in the middle (ISO C constraint). Signed-off-by: Keir Fraser --- .../drivers/xen/blkfront/blkfront.c | 15 ++++++++------- linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c | 3 ++- .../drivers/xen/xenbus/xenbus_probe.c | 6 ++++-- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c index 5f22d6af66..fbcaec2c4f 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c @@ -293,17 +293,18 @@ static void connect(struct blkfront_info *info) { unsigned long sectors, sector_size; unsigned int binfo; + int err; if (info->connected == BLKIF_STATE_CONNECTED) return; DPRINTK("blkfront.c:connect:%s.\n", info->xbdev->otherend); - int err = xenbus_gather(NULL, info->xbdev->otherend, - "sectors", "%lu", §ors, - "info", "%u", &binfo, - "sector-size", "%lu", §or_size, - NULL); + err = xenbus_gather(NULL, info->xbdev->otherend, + "sectors", "%lu", §ors, + "info", "%u", &binfo, + "sector-size", "%lu", §or_size, + NULL); if (err) { xenbus_dev_fatal(info->xbdev, err, "reading backend fields at %s", @@ -349,10 +350,10 @@ static void blkfront_closing(struct xenbus_device *dev) static int blkfront_remove(struct xenbus_device *dev) { - DPRINTK("blkfront_remove: %s removed\n", dev->nodename); - struct blkfront_info *info = dev->data; + DPRINTK("blkfront_remove: %s removed\n", dev->nodename); + blkif_free(info); kfree(info); diff --git a/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c b/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c index 7f4958038b..950dfa8f8c 100644 --- a/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c +++ b/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c @@ -118,10 +118,11 @@ static int netback_hotplug(struct xenbus_device *xdev, char **envp, struct backend_info *be = xdev->data; netif_t *netif = be->netif; int i = 0, length = 0; + char *val; DPRINTK("netback_hotplug"); - char *val = xenbus_read(NULL, xdev->nodename, "script", NULL); + val = xenbus_read(NULL, xdev->nodename, "script", NULL); if (IS_ERR(val)) { int err = PTR_ERR(val); xenbus_dev_fatal(xdev, err, "reading script"); diff --git a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c index 5d5093d6c3..230f379cdd 100644 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c @@ -284,6 +284,7 @@ static void otherend_changed(struct xenbus_watch *watch, struct xenbus_device *dev = container_of(watch, struct xenbus_device, otherend_watch); struct xenbus_driver *drv = to_xenbus_driver(dev->dev.driver); + XenbusState state; /* Protect us against watches firing on old details when the otherend details change, say immediately after a resume. */ @@ -294,9 +295,10 @@ static void otherend_changed(struct xenbus_watch *watch, return; } - XenbusState state = xenbus_read_driver_state(dev->otherend); + state = xenbus_read_driver_state(dev->otherend); - DPRINTK("state is %d, %s, %s", state, dev->otherend_watch.node, vec[XS_WATCH_PATH]); + DPRINTK("state is %d, %s, %s", + state, dev->otherend_watch.node, vec[XS_WATCH_PATH]); drv->otherend_changed(dev, state); } -- 2.30.2